package array
{
	import flash.utils.ByteArray;
	
	import data.Class;
	
	import tag.doABC2.CPool;
	
	import util.BytesUtil;
	import util.TraitUtil;

	public dynamic class ClassArray extends Array
	{
		public function ClassArray(...parameters)
		{
			super(parameters);
		}
		
		public function fill(bytes:ByteArray, count:uint):void
		{
			var cp:CPool = App.cp;
			if(count > 0){
				var c:data.Class = null;
				for(var i:int = 0;i < count; i++){
					c = new data.Class();
					this[i] = c;
					c.cinit = BytesUtil.readU30(bytes);
					var trait_count:uint = BytesUtil.readU30(bytes);
					for(var t:int = 0; t< trait_count; t++){
						c.traits[i] = TraitUtil.trait(bytes,cp);
					}
				}
			}
		}
		
		
	}
}